package Demo;

public class Demo06 {
    public static void main(String[] args) {
        // 赋值运算符 = += -= *= /= %=

        int x = 20;
        x += 20;//x = 40
        x -= 30; // x = 10
        x *= 5; //x = 50
        x /= 10; //x = 5
        System.out.println(x);

        //注意：赋值运算符即便超过该数据类型取值范围，也不会报错，但会出现精度损失，包含强制类型转换
        byte y = 127;
        y+= 873;
        System.out.println(y); //-24
    }
}
